Optimal. Leaf size=116 \[ \frac{(g+h x)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{2 h}-\frac{B n (b g-a h)^2 \log (a+b x)}{2 b^2 h}-\frac{B h n x (b c-a d)}{2 b d}+\frac{B n (d g-c h)^2 \log (c+d x)}{2 d^2 h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.148869, antiderivative size = 128, normalized size of antiderivative = 1.1, number of steps used = 5, number of rules used = 3, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.103, Rules used = {6742, 2492, 72} \[ -\frac{B n (b g-a h)^2 \log (a+b x)}{2 b^2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{B h n x (b c-a d)}{2 b d}+\frac{A (g+h x)^2}{2 h}+\frac{B n (d g-c h)^2 \log (c+d x)}{2 d^2 h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 2492
Rule 72
Rubi steps
\begin{align*} \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (g+h x)+B (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac{A (g+h x)^2}{2 h}+B \int (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac{A (g+h x)^2}{2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{(B (b c-a d) n) \int \frac{(g+h x)^2}{(a+b x) (c+d x)} \, dx}{2 h}\\ &=\frac{A (g+h x)^2}{2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{(B (b c-a d) n) \int \left (\frac{h^2}{b d}+\frac{(b g-a h)^2}{b (b c-a d) (a+b x)}+\frac{(d g-c h)^2}{d (-b c+a d) (c+d x)}\right ) \, dx}{2 h}\\ &=-\frac{B (b c-a d) h n x}{2 b d}+\frac{A (g+h x)^2}{2 h}-\frac{B (b g-a h)^2 n \log (a+b x)}{2 b^2 h}+\frac{B (d g-c h)^2 n \log (c+d x)}{2 d^2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}\\ \end{align*}
Mathematica [A] time = 0.167751, size = 124, normalized size = 1.07 \[ \frac{-a^2 B d^2 h n \log (a+b x)+b d \left (x (B h n (a d-b c)+A b d (2 g+h x))+B d (2 a g+b x (2 g+h x)) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )+b B n \log (c+d x) \left (2 a d^2 g+b c (c h-2 d g)\right )}{2 b^2 d^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.541, size = 839, normalized size = 7.2 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.16413, size = 208, normalized size = 1.79 \begin{align*} \frac{1}{2} \, B h x^{2} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac{1}{2} \, A h x^{2} + B g x \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g x + \frac{{\left (\frac{a e n \log \left (b x + a\right )}{b} - \frac{c e n \log \left (d x + c\right )}{d}\right )} B g}{e} - \frac{{\left (\frac{a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac{c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac{{\left (b c e n - a d e n\right )} x}{b d}\right )} B h}{2 \, e} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.01071, size = 413, normalized size = 3.56 \begin{align*} \frac{A b^{2} d^{2} h x^{2} +{\left (2 \, A b^{2} d^{2} g -{\left (B b^{2} c d - B a b d^{2}\right )} h n\right )} x +{\left (B b^{2} d^{2} h n x^{2} + 2 \, B b^{2} d^{2} g n x +{\left (2 \, B a b d^{2} g - B a^{2} d^{2} h\right )} n\right )} \log \left (b x + a\right ) -{\left (B b^{2} d^{2} h n x^{2} + 2 \, B b^{2} d^{2} g n x +{\left (2 \, B b^{2} c d g - B b^{2} c^{2} h\right )} n\right )} \log \left (d x + c\right ) +{\left (B b^{2} d^{2} h x^{2} + 2 \, B b^{2} d^{2} g x\right )} \log \left (e\right )}{2 \, b^{2} d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 5.78446, size = 201, normalized size = 1.73 \begin{align*} \frac{1}{2} \,{\left (A h + B h\right )} x^{2} + \frac{1}{2} \,{\left (B h n x^{2} + 2 \, B g n x\right )} \log \left (b x + a\right ) - \frac{1}{2} \,{\left (B h n x^{2} + 2 \, B g n x\right )} \log \left (d x + c\right ) - \frac{{\left (B b c h n - B a d h n - 2 \, A b d g - 2 \, B b d g\right )} x}{2 \, b d} + \frac{{\left (2 \, B a b g n - B a^{2} h n\right )} \log \left (b x + a\right )}{2 \, b^{2}} - \frac{{\left (2 \, B c d g n - B c^{2} h n\right )} \log \left (-d x - c\right )}{2 \, d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]